package org.come.Jpanel;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.GoodPanelBtn;
import com.tool.btn.RoleOperationPanelBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;



public class SetPasswordParentJpanel extends JPanel implements MouseListener {

    private JTextArea passAreaText;// 设置密码框

    private GoodPanelBtn btnSetPassword;// 设置密码按钮

    public SetPasswordParentJpanel() throws Exception {

    		this.setPreferredSize(new Dimension(218, 360));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 32);
            offBtn.setBounds(358 - 37, 10, 25, 25);
            this.add(offBtn);


        if("水墨UI".equals(MyIsif.getStyle())) {
            // 设置设置密码按钮  inkImg/old/pack/smXG.png
            btnSetPassword = new GoodPanelBtn("inkImg/old/pack/smXG.png", 1, " ");
            btnSetPassword.setBounds(55, 150, 140, 30);
            this.add(btnSetPassword);
        }else {
            btnSetPassword = new GoodPanelBtn("inkImg/old/pack/hmXG.png", 1, " ");
            btnSetPassword.setBounds(28, 150, 140, 35);
            this.add(btnSetPassword);
        }

    }

    ImageIcon iconSm;
    ImageIcon iconHm;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

        if("水墨UI".equals(MyIsif.getStyle())) {
            // 设置密码背景
            if (iconSm == null) {
                iconSm = new ImageIcon("inkImg/old/pack/smXgD.png");
            }
            g.drawImage(iconSm.getImage(), 0, 0, 218, 360, this);
        }else{
            // 设置密码背景
            if (iconHm == null) {
                iconHm = new ImageIcon("inkImg/old/pack/hmXgD.png");
            }
            g.drawImage(iconHm.getImage(), 0, 0, 193, 357, this);
        }

    }

    @Override
    public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public JTextArea getPassAreaText() {
        return passAreaText;
    }

    public void setPassAreaText(JTextArea passAreaText) {
        this.passAreaText = passAreaText;
    }

    public GoodPanelBtn getBtnSetPassword() {
        return btnSetPassword;
    }

    public void setBtnSetPassword(GoodPanelBtn btnSetPassword) {
        this.btnSetPassword = btnSetPassword;
    }
}
